import { service } from '@/service'

enum Api {
  area = 'areas'
}

export const areaList = (params?: any) => {
  return service.request({
    url: Api.area,
    method: 'GET',
    params
  })
}

export const areaDetail = (area: any) => {
  return service.request({
    url: Api.area + `/${area}`,
    method: 'GET'
  })
}

export const areaAdd = (data: any) => {
  return service.request({
    url: Api.area,
    method: 'POST',
    data
  })
}

export const areaEdit = (area: number, data: any) => {
  return service.request({
    url: Api.area + `/${area}`,
    method: 'put',
    data
  })
}

export const areaDel = (area: any) => {
  return service.request({
    url: Api.area + `/${area}`,
    method: 'DELETE'
  })
}
